import { Editor } from "@valuation/core";
import { Color, De, Dw, Fb, mokeData, Qd } from "./data.ts";
import { ChangelogExtension } from "@valuation/extension-change";
import { HistoryExtension } from "./ext.ts";

export function getEditor() {
  return new Editor({
    content(schema) {
      return mokeData(schema);
    },
    extensions: [
      HistoryExtension,
      ChangelogExtension,
      Dw,
      Fb,
      De,
      Qd,
      Color,
    ],
    onBeforeCreate() {
      console.log("beforeCreate");
    },
  });
}
